<include file="Public/header" />
<title>管理员列表</title>
</head>
<body>
<div class="pd-20" style="margin-top:-20px;">
	<div class="cl pd-5 bg-1 bk-gray mt-20"> 
		<form class="formleft" name="" id="" action="__URL__/goods/" method="get">
			<input class="input-text" style="width:200px" type="text" value="<{$_GET['goods_no']}>" placeholder="商品编码" name="goods_no">
			<input class="input-text" style="width:200px" type="text" value="<{$_GET['goods_name']}>" placeholder="商品名称" name="goods_name">
			<input class="input-text" style="width:200px" type="text" value="<{$_GET['goods_brand']}>" placeholder="品牌" name="goods_brand">
			<button type="submit" class="btn btn-success"><i class="icon-plus"></i> 查询</button>
		</form>
		<span class="r">共有数据：<strong><{$count}></strong> 条</span> 
    </div>
	
	<table class="table table-border table-bordered table-bg">
		<thead>
			<tr>
				<th scope="col" colspan="15">商品列表</th>
			</tr>
			<tr class="text-c">
				<th width="25" class="sorting_disabled" rowspan="1" colspan="1" aria-label="" style="width: 25px;"><input type="checkbox" name="" value=""></th>
				<th width="25">序号</th>
				<th width="">商品名称</th>
				<th width="">商品编码</th>
				<th width="">品牌</th>
				<th width="">型号</th>
				<th width="">规格</th>
				<th width="">缩略图</th>
				<th width="">价格</th>
				<th width="">库存</th>
				<th width="">净重(g)</th>
				<th width="">毛重(g)</th>
				<!-- <th width="">添加时间</th> -->
			</tr>
		</thead>
		<tbody>
			<volist name="list" id="vo">
			<tr class="text-c">
				<td><input type="checkbox" value="<{$vo.id}>" name="" class="ids"></td>
				<td><{$i}></td>
				<td><{$vo.goods_name}></td>
				<td><{$vo.goods_no}></td>
				<td><{$vo.goods_brand}></td>
				<td><{$vo.goods_marque}></td>
				<td><{$vo.goods_spec}></td>
				<td>
				<img src="<{:get_pic($vo['goods_pic'])}>" style="width:50px" />
				</td>
				<td><{$vo.goods_price}></td>
				<td><{$vo.storage_amount}></td>
				<td><{$vo.net_weight}></td>
				<td><{$vo.gross_weight}></td>
				<!-- <td><{$vo.add_time|date="Y-m-d",###}></td> -->
			</tr>
			</volist>			
		</tbody>
	</table>
	<div class="page mt" style="text-align:right">
		<{$page}>
		<button type="submit" onclick="add(<{:I('order_id')}>)" class="btn btn-success"><i class="icon-plus"></i> 添加</button>
	</div>
</div>
<script>
	function add(order_id){
		var option = $(".ids");
		var checked_counts=0;
		var check_val = [];
        for(var i=0;i<option.length;i++){
			if(option[i].checked){
				checked_counts++;
				check_val.push(option[i].value);
			}
		}
		if(checked_counts==0){
			layer.msg('请选择内容');
			return false;
		}else{
			$.ajax({
				type: 'POST',
				data: {order_id:order_id,ids:check_val},
				url: "<{:U('adds_orderdetail')}>",
				success:function(data){
					if(data.status==1){	//检查通过，跳转生成波次单页面
						layer.msg(data.message,function(){
							parent.window.location.href=parent.window.location.href;
						});
					}else{			//检查未通过，刷新页面
						layer.msg(data.message);
					}
					return false;
				}
			})
		}
	}
</script>
<include file="Public/footer" />
<include file="Public/footer_js" />
</body>
</html>